<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta charset="utf-8">
<title>生产详情表</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../res/css/layui.css" media="all">
<script type="text/javascript" src="../../res/js/jquery-1.11.2.min.js"></script>
<style>
*{margin:0;padding:0;list-style:none;}
a{text-decoration:none;}
/* insertFootDiv */
#insertFootDiv{width:900px;height:auto;margin:0 auto;}
#insertFootDiv ul{overflow:hidden;padding:1em 1em 3em 1em;}
#insertFootDiv ul li{float:left;margin:1.5em;text-align: center;line-height: 1px;}
#insertFootDiv ul li a{display:block;height:1px;background:#fff;color:#000;padding:1em;/* 阴影处理 */box-shadow:5px 5px 7px rgba(33,33,33,0.9);-webkit-transform:rotate(-10deg);
position:relative;}
#insertFootDiv ul li:nth-child(even) a{-webkit-transform:rotate(8deg);top:10px;background:#AAEECC; }
#insertFootDiv ul li:nth-child(3n) a{-webkit-transform:rotate(8deg);top:-10px;background:#F2DFD1;}
#insertFootDiv ul li:nth-child(5n) a{-webkit-transform:rotate(5deg);background:#C6Fdd6;}
#insertFootDiv ul li a:hover{box-shadow:10px 10px 10px rgba(0,0,0,0.6);-webkit-transform:scale(1.25);z-index:111;-webkit-transition:-webkit-transform 0.2s linear;}
#insertFootDiv ul li h2{font-size:18px;font-weight:bold;padding:5px;}
#insertFootDiv ul li p{line-height:30px;font-size:14px;font-family:'微软雅黑';}

</style>
</head>
<body>
	<div class="demoTable" style="margin-left: 20px; margin-top: 10px;">
		<button class="layui-btn layui-btn-sm" id="selectButton" data-type="getCheckData">确认保存</button>
		<button class="layui-btn layui-btn-warm layui-btn-sm" id="insert">增加</button>
	</div>
	<table id="myTable" class="layui-table"
		lay-data="{ url:'../../prodetail/findDuction.action', page:true, id:'idTest'}"
		lay-filter="demo">
		<thead>
			<tr>
				<th lay-data="{field:'deId', align:'center'}">详情编号</th>
				<th lay-data="{field:'comName',sort: true, align:'center'}">商品名称</th>
				<th lay-data="{field:'deNumber', align:'center', sort: true,edit: 'text'}">生产数量</th>
				<th lay-data="{fixed: 'right',align:'center', toolbar: '#barDemo'}">操作</th>
			</tr>
		</thead>
	</table>
<script type="text/html" id="barDemo">
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>

<div id="insertCom" style="display: none;">
		<div id="insertComBody">
			<div id="insertComBodyHeader"></div>
			<div class="demoTable" style="margin-left: 20px; margin-top: 20px;">
				商品名称:
				<div class="layui-inline">
					<input class="layui-input" id="comName" style="width:150px;" maxlength="7"
						placeholder="请输入商品名称" autocomplete="off">
				</div>
				
				商品类型:
				<from class="layui-form">
				<div class="layui-inline">
					<select lay-filter="aihao" id="typeId"
						style="width: 80px;">
						
					</select>
				</div>
				</from>


				<button class="layui-btn layui-btn-sm" data-type="reload" id="selectButton">搜索</button>
				<button class="layui-btn layui-btn-warm layui-btn-sm" id="addButton" data-type="getAdd">确认添加</button>
				<button class="layui-btn layui-btn-danger layui-btn-sm" id="exit">取消</button>
			</div>
			
			<input type="hidden" id="comIdInput"/>
			<table id="insertTable" class="layui-hide"  lay-filter="insertTable">
				<!-- <thead>
					<tr>
						<th lay-data="{type:'checkbox', fixed: 'left'}"></th>
						<th lay-data="{field:'typeName',align:'center'}">药品类型</th>
						<th lay-data="{field:'comId',sort: true, align:'center'}">商品id</th>
						<th lay-data="{field:'comName',sort: true, align:'center'}">商品名称</th>
						<th lay-data="{field:'comImage', align:'center', sort: true,toolbar: '#Image'}">商品图片</th>
						<th lay-data="{field:'comUnit', align:'center'}">商品单位</th>
						<th lay-data="{field:'ciTrade', align:'center'}">批发价</th>
						<th lay-data="{field:'ciRetail', align:'center'}">零售价</th>
					</tr>
				</thead> -->
			</table>
			
			<div id="insertFootDiv" style="margin-bottom: 100px;">
				<ul>
					123
				</ul>
			</div>
			<script type="textml" id="Image">
    			<img style="width:30px;height:23px;" src="{{ d.comImage }}">
			</script>
		</div>
	</div>

	<script src="../../res/layui.all.js" charset="utf-8"></script>
	<script type="text/javascript" src="../../res/js/cst/snprodetail.js"></script>
	
	<!-- 动态赋值表格 -->	
	<script type="text/javascript">
					layui.use('table', function(){
					  var table = layui.table;
					  
					  table.render({
					    elem: '#insertTable'
					    ,page:true
					    ,url:'../../commodity/findAll.action'
					    ,cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
					    ,cols: [[
					    	{type:'checkbox', sort: true}
					       ,{field:'typeName',  title: '药品类型', sort: true}
					      ,{field:'comId', title: '商品id'}
					      ,{field:'comName',  title: '商品名称', sort: true}
					      ,{field:'comImage',  title: '商品图片'}
					      ,{field:'comUnit', title: '商品单位'} //minWidth：局部定义当前单元格的最小宽度，layui 2.2.1 新增
					      ,{field:'ciTrade', title: '批发价', sort: true}
					      ,{field:'ciRetail', title: '零售价', sort: true}
					    ]]
					  //表格加载完成的回调函数
					   ,done: function (res, curr, count) {
							
						   $.each($(".layui-table-col-special"),function(index,item){
								var comId=$(item).next().next().children().html();
								if(comId!=undefined && comId!=''){
									$.each($("#comIdInput").val().split("@"),function(indexs,items){
										if(items==($(item).next().next().children().html())){
											console.info($(item).children().children(":first"));
											var check=$(item).children().children(":first").get(0);
											$(check).attr({"checked":true});
											load();
										}
									});
								};

							});
						   
					    }
					  });
					});
			</script>
</body>
</html>